/*
 *
 *    Copyright (c) 2022 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP
// This file is generated from clusters-Structs.h.zapt

#pragma once

#include <app/data-model/DecodableList.h>
#include <app/data-model/List.h>
#include <app/data-model/Nullable.h>
#include <lib/core/DataModelTypes.h>
#include <lib/core/Optional.h>
#include <lib/core/TLV.h>
#include <lib/support/BitMask.h>

#include <clusters/shared/Structs.h>

#include <cstdint>

namespace chip
{
namespace app
{
	namespace Clusters
	{
		namespace Channel
		{
			namespace Structs
			{
				namespace ProgramCastStruct
				{
					enum class Fields : uint8_t {
						kName = 0,
						kRole = 1,
					};

					struct Type {
					public:
						chip::CharSpan name;
						chip::CharSpan role;

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					using DecodableType = Type;

				} // namespace ProgramCastStruct
				namespace ProgramCategoryStruct
				{
					enum class Fields : uint8_t {
						kCategory = 0,
						kSubCategory = 1,
					};

					struct Type {
					public:
						chip::CharSpan category;
						Optional<chip::CharSpan> subCategory;

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					using DecodableType = Type;

				} // namespace ProgramCategoryStruct
				namespace SeriesInfoStruct
				{
					enum class Fields : uint8_t {
						kSeason = 0,
						kEpisode = 1,
					};

					struct Type {
					public:
						chip::CharSpan season;
						chip::CharSpan episode;

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					using DecodableType = Type;

				} // namespace SeriesInfoStruct
				namespace ChannelInfoStruct
				{
					enum class Fields : uint8_t {
						kMajorNumber = 0,
						kMinorNumber = 1,
						kName = 2,
						kCallSign = 3,
						kAffiliateCallSign = 4,
						kIdentifier = 5,
						kType = 6,
					};

					struct Type {
					public:
						uint16_t majorNumber = static_cast<uint16_t>(0);
						uint16_t minorNumber = static_cast<uint16_t>(0);
						Optional<chip::CharSpan> name;
						Optional<chip::CharSpan> callSign;
						Optional<chip::CharSpan> affiliateCallSign;
						Optional<chip::CharSpan> identifier;
						Optional<ChannelTypeEnum> type;

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					using DecodableType = Type;

				} // namespace ChannelInfoStruct
				namespace ProgramStruct
				{
					enum class Fields : uint8_t {
						kIdentifier = 0,
						kChannel = 1,
						kStartTime = 2,
						kEndTime = 3,
						kTitle = 4,
						kSubtitle = 5,
						kDescription = 6,
						kAudioLanguages = 7,
						kRatings = 8,
						kThumbnailUrl = 9,
						kPosterArtUrl = 10,
						kDvbiUrl = 11,
						kReleaseDate = 12,
						kParentalGuidanceText = 13,
						kRecordingFlag = 14,
						kSeriesInfo = 15,
						kCategoryList = 16,
						kCastList = 17,
						kExternalIDList = 18,
					};

					struct Type {
					public:
						chip::CharSpan identifier;
						Structs::ChannelInfoStruct::Type channel;
						uint32_t startTime = static_cast<uint32_t>(0);
						uint32_t endTime = static_cast<uint32_t>(0);
						chip::CharSpan title;
						Optional<chip::CharSpan> subtitle;
						Optional<chip::CharSpan> description;
						Optional<DataModel::List<const chip::CharSpan>> audioLanguages;
						Optional<DataModel::List<const chip::CharSpan>> ratings;
						Optional<chip::CharSpan> thumbnailUrl;
						Optional<chip::CharSpan> posterArtUrl;
						Optional<chip::CharSpan> dvbiUrl;
						Optional<chip::CharSpan> releaseDate;
						Optional<chip::CharSpan> parentalGuidanceText;
						Optional<chip::BitMask<RecordingFlagBitmap>> recordingFlag;
						Optional<DataModel::Nullable<Structs::SeriesInfoStruct::Type>>
							seriesInfo;
						Optional<DataModel::List<const Structs::ProgramCategoryStruct::Type>>
							categoryList;
						Optional<DataModel::List<const Structs::ProgramCastStruct::Type>>
							castList;
						Optional<DataModel::List<const Structs::ProgramCastStruct::Type>>
							externalIDList;

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					struct DecodableType {
					public:
						chip::CharSpan identifier;
						Structs::ChannelInfoStruct::DecodableType channel;
						uint32_t startTime = static_cast<uint32_t>(0);
						uint32_t endTime = static_cast<uint32_t>(0);
						chip::CharSpan title;
						Optional<chip::CharSpan> subtitle;
						Optional<chip::CharSpan> description;
						Optional<DataModel::DecodableList<chip::CharSpan>> audioLanguages;
						Optional<DataModel::DecodableList<chip::CharSpan>> ratings;
						Optional<chip::CharSpan> thumbnailUrl;
						Optional<chip::CharSpan> posterArtUrl;
						Optional<chip::CharSpan> dvbiUrl;
						Optional<chip::CharSpan> releaseDate;
						Optional<chip::CharSpan> parentalGuidanceText;
						Optional<chip::BitMask<RecordingFlagBitmap>> recordingFlag;
						Optional<DataModel::Nullable<Structs::SeriesInfoStruct::DecodableType>>
							seriesInfo;
						Optional<DataModel::DecodableList<
							Structs::ProgramCategoryStruct::DecodableType>>
							categoryList;
						Optional<DataModel::DecodableList<
							Structs::ProgramCastStruct::DecodableType>>
							castList;
						Optional<DataModel::DecodableList<
							Structs::ProgramCastStruct::DecodableType>>
							externalIDList;

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;
					};

				} // namespace ProgramStruct
				namespace PageTokenStruct
				{
					enum class Fields : uint8_t {
						kLimit = 0,
						kAfter = 1,
						kBefore = 2,
					};

					struct Type {
					public:
						Optional<uint16_t> limit;
						Optional<chip::CharSpan> after;
						Optional<chip::CharSpan> before;

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					using DecodableType = Type;

				} // namespace PageTokenStruct
				namespace ChannelPagingStruct
				{
					enum class Fields : uint8_t {
						kPreviousToken = 0,
						kNextToken = 1,
					};

					struct Type {
					public:
						Optional<DataModel::Nullable<Structs::PageTokenStruct::Type>>
							previousToken;
						Optional<DataModel::Nullable<Structs::PageTokenStruct::Type>> nextToken;

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					using DecodableType = Type;

				} // namespace ChannelPagingStruct
				namespace AdditionalInfoStruct
				{
					enum class Fields : uint8_t {
						kName = 0,
						kValue = 1,
					};

					struct Type {
					public:
						chip::CharSpan name;
						chip::CharSpan value;

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					using DecodableType = Type;

				} // namespace AdditionalInfoStruct
				namespace LineupInfoStruct
				{
					enum class Fields : uint8_t {
						kOperatorName = 0,
						kLineupName = 1,
						kPostalCode = 2,
						kLineupInfoType = 3,
					};

					struct Type {
					public:
						chip::CharSpan operatorName;
						Optional<chip::CharSpan> lineupName;
						Optional<chip::CharSpan> postalCode;
						LineupInfoTypeEnum lineupInfoType = static_cast<LineupInfoTypeEnum>(0);

						CHIP_ERROR Decode(TLV::TLVReader &reader);

						static constexpr bool kIsFabricScoped = false;

						CHIP_ERROR Encode(TLV::TLVWriter &aWriter, TLV::Tag aTag) const;
					};

					using DecodableType = Type;

				} // namespace LineupInfoStruct
			} // namespace Structs
		} // namespace Channel
	} // namespace Clusters
} // namespace app
} // namespace chip
